<div class="bm" id="main_messaqge">
	<h1 class="mt wx">{lang group_create_new}</h1>
	<form method="post" autocomplete="off" name="groupform" id="groupform" class="s_clear" onsubmit="ajaxpost('groupform', 'returnmessage4', 'returnmessage4', 'onerror');return false;" action="forum.php?mod=group&action=create">
		<input type="hidden" name="formhash" value="{FORMHASH}" />
		<input type="hidden" name="referer" value="$_G[referer]" />
		<input type="hidden" name="handlekey" value="creategroup" />
		<table cellspacing="0" cellpadding="0" class="tfm" summary="{lang group_create}">
			<tbody>
				<tr>
					<th></th>
					<td><strong class="rq"><em id="returnmessage4"></em></strong><strong class="q y">{lang group_you_have}</strong></td>
				</tr>
				<tr>
					<th><strong class="rq y">*</strong>{lang group_name}:</th>
					<td><input type="text" name="name" id="name" class="px" size="36" tabindex="1" value="" autocomplete="off" onBlur="checkgroupname()" tabindex="1" /></td>
				</tr>
				<tr>
					<th><strong class="rq y">*</strong>{lang group_category}:</th>
					<td>
						<select name="" tabindex="2" class="ps" onchange="ajaxget('forum.php?mod=ajax&action=secondgroup&fupid='+ this.value, 'secondgroup');">
							<option value="0">{lang choose_please}</option>
							$groupselect[first]
						</select>
						<em id="secondgroup"><select name="fup" id="fup" class="ps" ><option value="">{lang option_required}</option></select></em>
					</td>
				</tr>
				<tr>
					<th>{lang group_description}:</th>
					<td><textarea rows="4" cols="40" name="descriptionnew" tabindex="3" class="pt"></textarea></td>
				</tr>
				<tr>
					<th><strong class="rq y">*</strong>{lang group_perm_visit}:</th>
					<td><input type="radio" name="gviewperm" class="pr" tabindex="4" value="1" checked="checked"> {lang group_perm_all_user} <input type="radio" class="pr" name="gviewperm" value="0"> {lang group_perm_member_only}</td>
				</tr>
				<tr>
					<th><strong class="rq y">*</strong>{lang group_join_type}:</th>
					<td><input type="radio" name="jointype" class="pr" tabindex="5" value="0" checked="checked"> {lang group_join_type_free} <input type="radio" class="pr" name="jointype" value="2"> {lang group_join_type_moderate} <input type="radio" class="pr" name="jointype" value="1"> {lang group_join_type_invite}</td>
				</tr>
				<tr>
					<th></th>
					<td>{lang group_create_notice}</td>
				</tr>
				<tr>
					<th></th>
					<td><input type="hidden" name="createsubmit" value="true"><button type="submit" class="pn pnp" tabindex="6"><strong>{lang create}</strong></button></td>
				</tr>
			</tbody>
		</table>
	</form>
</div>
<script type="text/javascript">
	function checkgroupname() {
		var groupname = trim($('name').value);
	    ajaxget('forum.php?mod=ajax&forumcheck=1&infloat=creategroup&handlekey=creategroup&action=checkgroupname&groupname=' + (BROWSER.ie && document.charset == 'utf-8' ? encodeURIComponent(groupname) : groupname), 'returnmessage4');
	}
	function succeedhandle_creategroup(locationhref, message) {
		showDialog(message, 'notice', '', 'location.href="' + locationhref + '"');
	}
	<!--{if $_G['gp_fupid']}-->
			ajaxget('forum.php?mod=ajax&action=secondgroup&fupid=$_G[gp_fupid]{if $_G[gp_groupid]}&groupid=$_G[gp_groupid]{/if}', 'secondgroup');
	<!--{/if}-->
</script>